package com.one.efaimaly.user.model;

import com.one.common.model.http.NetConstant;
import com.one.common.model.http.base.BaseModel;
import com.one.common.model.http.callback.ObserverOnResultListener;
import com.one.common.view.base.BaseActivity;
import com.one.common.model.bean.UserWorkerBean;

import java.util.Map;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/8/5 下午5:43
 * description ：
 **/
public class UserWorkerModel extends BaseModel<UserWorkerApi> {
    public UserWorkerModel(BaseActivity mActivity) {
        super(UserWorkerApi.class, mActivity, NetConstant.APP_HOST_WORKER);
    }

    /**
     * 获取师傅特有用户信息
     */
    public void getUserWorkerInfo(ObserverOnResultListener<UserWorkerBean> listener){
        handleOnResultObserverNoActivity(mApiService.getUserWorkerInfo(getParams()), listener);
    }


    /**
     * 更新师傅独有信息
     */
    public void updateWorkerUserInfo(Map<String , String> params, ObserverOnResultListener<String> listener){
        params.putAll(getParams());
        handleOnResultObserver(mApiService.updateWorkerUserInfo(params), listener);
    }

}
